<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">
    <ui:define name="head">
        <script type="text/javascript" src="#{request.contextPath}/UI/support/pub.js"/>
        <script type="text/javascript" language="javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                    else
                        event.srcElement.click();
                }
            }
        </script>
        <style type="text/css">
            .c_c {
                background: gray;
            }
        </style>
    </ui:define>
    <ui:define name="content">
        <div style="margin:5px;">
            <h:form id="form">
                <p:growl id="msgs" showDetail="false"/>
                <p:panel id="inputItemHieRelap" header="总包合同数量_统计查询" style="width: 100%">
                    <h:panelGrid columns="2" style="width: 100%">
                        <h:panelGrid id="pgItemHieRelapInput" widgetVar="wvItemHieRelap"
                                     columns="10" style="width: 100%">

                            <h:outputLabel for="noItemHieRelap" value="编号:"/>
                            <h:inputText id="noItemHieRelap"
                                         value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.tkctt_StrNo}"
                                         style="font-weight:bold;background-color:gainsboro"
                                         disabled="true">
                            </h:inputText>

                            <h:outputLabel for="name" value="名称:"/>
                            <h:inputText id="name"
                                         value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.tkctt_Name}"
                                         style="font-weight:bold;background-color:gainsboro"
                                         disabled="true"/>

                            <h:outputLabel for="note" value="备注内容:"/>
                            <h:inputTextarea id="note"
                                             value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.tkctt_Note}"
                                             rows="1" autoResize="false"
                                             style="font-weight:bold;background-color:gainsboro"
                                             disabled="true"/>

                            <h:outputLabel for="unitItemInfo" value="单位:"/>
                            <h:inputText id="unitItemInfo"
                                         value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.tkctt_Unit}"
                                         style="font-weight:bold;background-color:gainsboro"
                                         disabled="true"/>

                            <h:outputLabel for="contractQuantityItemInfo" value="合同数量:"/>
                            <h:inputText id="contractQuantityItemInfo"
                                         value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.tkctt_ContractQuantity}"
                                         style="font-weight:bold;background-color:gainsboro;text-align:right;float:left;"
                                         disabled="true">
                                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                            </h:inputText>

                            <h:outputLabel for="eng_BeginToCurrentPeriodEQty" value="开累工程数量:"/>
                            <h:inputText id="eng_BeginToCurrentPeriodEQty"
                                         value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.eng_BeginToCurrentPeriodEQty}"
                                         style="font-weight:bold;background-color:gainsboro;text-align:right;float:left;"
                                         disabled="true">
                                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                            </h:inputText>

                            <h:outputLabel for="eng_CurrentPeriodEQty" value="本期工程数量:"/>
                            <h:inputText id="eng_CurrentPeriodEQty"
                                         value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstruct.eng_CurrentPeriodEQty}"
                                         style="font-weight:bold;background-color:gainsboro;text-align:right;float:left;"
                                         disabled="true">
                                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                            </h:inputText>
                        </h:panelGrid>
                    </h:panelGrid>
                </p:panel>
                <p:ajaxStatus style="width:16px;height:16px;">
                    <f:facet name="start">
                        <h:graphicImage value="/images/ajaxloading.gif"/>
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value=""/>
                    </f:facet>
                </p:ajaxStatus>
                <p:dataTable id="ptt" style="width:100%;"
                             value="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstructList}"
                             var="record"
                             rowKey="#{record.tkctt_Pkid}"
                             selection="#{itemHieRelapStlEngStaAction.stlTkcttEngSMConstructSelected}"
                             selectionMode="single"
                             paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink}
                                            {LastPageLink} {RowsPerPageDropdown}"
                             paginator="true"
                             paginatorPosition="bottom"
                             rows="100"
                             rowsPerPageTemplate="200,100,50,40,30,20,10"
                             rowIndexVar="row"
                             emptyMessage="数据记录为空..."
                             stickyHeader="#{itemHieRelapStlEngStaAction.strStickyHeaderFlag}">
                    <!--rowStyleClass="#{record.tkctt_ContractQuantity eq null? 'c_c':null}"-->
                    <p:ajax event="rowSelect" listener="#{itemHieRelapStlEngStaAction.onRowSelect}"
                            update=":form:inputItemHieRelap"/>

                    <p:column headerText="序号">
                        <h:outputText value="#{row + 1}"/>
                    </p:column>

                    <p:column style="width:100px" headerText="编号">
                        <h:outputText value="#{record.tkctt_StrNo}" escape="false"/>
                    </p:column>

                    <p:column style="width:15px" headerText="层级">
                        <h:outputText value="#{record.tkctt_Grade}" escape="false"/>
                        <!--<h:outputText value="&#8195;&#8195;ttt#{record.grade}"/>-->
                    </p:column>

                    <p:column style="width:15px" headerText="序号">
                        <h:outputText value="#{record.tkctt_Orderid}" escape="false"/>
                    </p:column>

                    <p:column style="width:200px" headerText="名称">
                        <h:outputText value="#{record.tkctt_Name}"/>
                    </p:column>

                    <p:column style="width:30px" headerText="单位">
                        <h:outputText value="#{record.tkctt_Unit}" style="text-align:right"/>
                    </p:column>

                    <p:column style="width:80px" headerText="合同数量">
                        <h:outputText value="#{record.tkctt_ContractQuantity}" style="float: right">
                            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                        </h:outputText>
                    </p:column>

                    <p:column style="width:80px" headerText="合同金额">
                        <h:outputText value="#{record.tkctt_ContractAmount}" style="float: right">
                            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                        </h:outputText>
                    </p:column>

                    <p:column headerText="开累工程数量">
                        <h:outputText value="#{record.eng_BeginToCurrentPeriodEQty}" style="float: right">
                            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                        </h:outputText>
                    </p:column>

                    <p:column headerText="开累工程金额">
                        <h:outputText value="#{record.eng_BeginToCurrentPeriodEAmount}" style="float: right">
                            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                        </h:outputText>
                    </p:column>

                    <p:column headerText="当期工程数量">
                        <h:outputText value="#{record.eng_CurrentPeriodEQty}" style="float: right">
                            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                        </h:outputText>
                    </p:column>

                    <p:column headerText="当期工程金额">
                        <h:outputText value="#{record.eng_CurrentPeriodEAmount}" style="float: right">
                            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                        </h:outputText>
                    </p:column>

                </p:dataTable>
            </h:form>
        </div>
    </ui:define>
</ui:composition>